<?php

/**
 * Predmet form base class.
 *
 * @package    dnevnik
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BasePredmetForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'             => new sfWidgetFormInputHidden(),
      'predmet'        => new sfWidgetFormInput(),
      'predmet_naziv'  => new sfWidgetFormInput(),
      'predmet_kratki' => new sfWidgetFormInput(),
      'tip'            => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'             => new sfValidatorPropelChoice(array('model' => 'Predmet', 'column' => 'id', 'required' => false)),
      'predmet'        => new sfValidatorString(array('max_length' => 3)),
      'predmet_naziv'  => new sfValidatorString(array('max_length' => 50)),
      'predmet_kratki' => new sfValidatorString(array('max_length' => 12)),
      'tip'            => new sfValidatorInteger(),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'Predmet', 'column' => array('predmet')))
    );

    $this->widgetSchema->setNameFormat('predmet[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Predmet';
  }


}
